package com.dynabook.ems.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dynabook.ems.model.dto.ReturnMachineListDTO;
import com.dynabook.ems.model.dto.WorkOrderSampleApprovalListRequest;
import com.dynabook.ems.model.entity.EmsMyBorrow;
import com.dynabook.ems.model.vo.ReturnMachineListVO;
import com.dynabook.ems.model.vo.SampleListVO;
import com.dynabook.ems.model.vo.WorkOrderSampleApprovalListVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author tester
* @description 针对表【ems_my_borrow】的数据库操作Mapper
* @createDate 2025-07-01 13:58:28
* @Entity com.dynabook.ems.model.entity.EmsMyBorrow
*/
public interface EmsMyBorrowMapper extends BaseMapper<EmsMyBorrow> {


    @Select("select GETREQUESTNO() as REQUESTNO;")
    String getRequestNo();

    Page<ReturnMachineListVO> getMachineList(Page<ReturnMachineListVO> page,  @Param("params") ReturnMachineListDTO returnMachineListDTO);
    
    /**
     * 根据用户ID分页查询用户已借的样品列表
     * @param page 分页参数
     * @param userId 用户ID
     * @param searchText 搜索文本（可选）
     * @return 样品列表
     */
    Page<SampleListVO> pageMyBorrowedSampleList(Page<SampleListVO> page, @Param("userId") String userId, @Param("searchText") String searchText,@Param("type") String type);

/**
     * 分页查询样机工单待审批列表
     * @param page 分页对象
     * @param request 查询条件
     * @return 样机工单待审批列表
     */
    Page<WorkOrderSampleApprovalListVO> pageWorkOrderSampleApprovalList(Page<WorkOrderSampleApprovalListVO> page, @Param("request") WorkOrderSampleApprovalListRequest request);

    /**
     * 分页查询样机工单代分配类别列表
     * @param page 分页对象
     * @param request 查询条件
     * @return 样机工单代分配类别列表
     */
    Page<WorkOrderSampleApprovalListVO> pageWorkOrderSampleAssignmentList(Page<WorkOrderSampleApprovalListVO> page, @Param("request") WorkOrderSampleApprovalListRequest request);
}




